pygrub: fix non-interactive parsing of grub1 config files
authorSimon Rowe <simon.rowe@eu.citrix.com>
Mon, 27 Oct 2014 16:00:14 +0000 (16:00 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 4 Nov 2014 10:00:37 +0000 (10:00 +0000)
commit4ee393f9d6528640c29a0554fdc6cb3e795fb6e8
tree1bad19843d38ffd1187b378c5868ba83ee36566a
parent5283b310e14884341f51be35253cdd59c4cb034c
pygrub: fix non-interactive parsing of grub1 config files

Changes to handle non-numeric default attributes for grub2 caused run_grub()
to attempt to index into the images list using a string. Pull out the code
that handles submenus into a new function and use that to ensure sel is
numeric.

Reported-by: David Scott <dave.scott@citrix.com>
Signed-off-by: Simon Rowe <simon.rowe@eu.citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-and-tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/pygrub/src/pygrub